Skip to content
This repository was archived by the owner on Oct 6, 2026. It is now read-only.

Add update_tracking endpoint to Fulfillment - #432

Merged
mllemango merged 3 commits into
masterfrom
melaniew/add_fulfillment_update_tracking
Jan 12, 2021
Merged

mllemango merged 3 commits into
masterfrom
melaniew/add_fulfillment_update_tracking

Conversation

@mllemango

@mllemango mllemango commented Nov 11, 2020 •

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

The fulfillment API has a clear method of updating tracking information that our library doesn't support.
This may help reduce issues such as #310.

WHAT is this pull request doing?

Following the footsteps of shopify_api, a new class was created in order to hit the end point /fulfillments/$fulfillment_id

Checklist

  • I have updated the CHANGELOG (if applicable)
  • I have followed the Shopify Python guide

class FulfillmentOrders(ShopifyResource):
_prefix_source = "/orders/$order_id/"

class FulfillmentV2(ShopifyResource):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I follow the idea of the V2 nomenclature, is there a particular reason we can't just do this in Fulfillment? If the class is absolutely necessary, we might want to consider renaming it to something that better conveys what it does.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe we can do it in the original Fulfillment class because that class points to /orders/$order_id/fulfillment/$fulfillment_id, and the endpoint in this case is only fulfillment/$fulfillment_id. I would also prefer to do it in 1 class, but I'm not quite sure how..
The V2 nomenclature is from shopify_api (that is used by Fulfillment.rb) in a similar manner. Thought I would keep it consistent between the two libs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of that makes perfect sense, thanks for the context! I'm still not a fan of calling it V2 but I agree we should keep them consistent.

Not saying we should do this, but I wonder if it wouldn't be cleaner to change _prefix_source for that particular method rather than adding a whole new class for it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried manipulating _prefix_source but wasn't successful with my attempt. I do believe the convention of changing prefixes is to override the classmethod _prefix depending on passed in options, but in this case the usage is after we define a Fulfillment object already :/
Thus new class

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing wrong with this approach, I was just thinking aloud there!

@mllemango
mllemango force-pushed the melaniew/add_fulfillment_update_tracking branch from da3ce77 to d837bfd Compare January 12, 2021 16:34

@paulomarg paulomarg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mllemango
mllemango merged commit 60d6c23 into master Jan 12, 2021
@mllemango
mllemango deleted the melaniew/add_fulfillment_update_tracking branch January 12, 2021 17:03
@NabeelAhsen NabeelAhsen mentioned this pull request Mar 17, 2021
2 tasks done

This branch had an error being deployed

1 failed deployment
pypi — d837bfd1 Deployed Apr 9, 2024 by shopify-shipit[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants